package com.lovelc.cn.service.impl;

import com.lovelc.cn.dao.PersonDao;
import com.lovelc.cn.po.Person;
import com.lovelc.cn.service.DataSourceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Random;

/**
 * @ClassName DataSourceServiceImpl
 * @Description TODO
 * @Author huangjh5
 * @Date 2021/1/4 16:24
 */
@Service
public class DataSourceServiceImpl implements DataSourceService {

    @Resource
    PersonDao personDao;


    @Override
    public void save() {
        Person person = new Person();
        Random random = new Random();
        person.setName( "小红" + random.nextInt(100));
        person.setAge(random.nextInt(30));
        personDao.save(person);
    }
}
